package com.example.demo.service;

import com.example.demo.model.bean.User;
import com.example.demo.model.dao.UserDAO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.UUID;
@Service
public class UserServiceImpl implements UserService{
    @Autowired
    private UserDAO userDAO;
    @Override
    public User insert(String mobile) {
    User user = new User();
    user.setMobile(mobile);
    String id =  UUID.randomUUID().toString();
    user.setId(id);
    userDAO.insert(user);
    User user1 = userDAO.find(user);
    return user1;
    }
}
